﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLBH.Base;
using QLBH.DataModel;
using QLBH.ModelInterface;

namespace QLBH.FeatureModel
{
    public class QLKhoModel:IQLKhoModel
    {
        public Guid KhoID { set; get; }
        public String MaKho { set; get; }
        public String TenKho { set; get; }
        public String DiaChi { set; get; }
        public String GhiChu { set; get; }
        public bool MacDinh { set; get; }

        public void InitFromEntity(KHO entity)
        {
            KhoID = entity.KHOID;
            MaKho = entity.KHOCODE;
            TenKho = entity.TENKHO;
            DiaChi = entity.DIACHI;
            GhiChu = entity.GHICHU;
            MacDinh = (bool)entity.MACDINH;
        }

        public KHO ToEntity()
        {
            KHO entity = new KHO();
            entity.KHOID = KhoID;
            entity.TENKHO = TenKho;
            entity.DIACHI = DiaChi;
            entity.GHICHU = GhiChu;
            entity.KHOCODE = MaKho;
            entity.MACDINH = MacDinh;

            return entity;
        }
    }
}
